package krow.dev.weathertest;

import com.example.weathertest.*;

import android.content.*;
import android.graphics.*;
import android.util.*;
import android.view.*;
import android.widget.*;

public class ViewPagerAdd { // 뷰페이저에 추가할 뷰에 대한 설정. 뷰를 등록하고 그 뷰에 담긴 애들까지 지정해줌.
	public static final int TYPE_HomeView = 0, TYPE_1stVIEW=1, TYPE_2ndVIEW=2;
	//public static final int TYPE_TEXTVIEW = 0;
	public LayoutInflater mInflater;
	View v = null;
	
	public View getView(int type, Context con) {
		mInflater = LayoutInflater.from(con);
		if(type == TYPE_HomeView){
			return getHomeView(con);
		}
			
		else if(type == TYPE_1stVIEW){
			return get1stView(con);
		}
			
		else if(type == TYPE_2ndVIEW){
			return get2ndView(con);
		}
		return null;
			
		
		
	}
	
	public View getHomeView(Context con) {
		//View v = null;
		//mInflater = LayoutInflater.from(con);
		
		v = mInflater.inflate(R.layout.activity_main, null);
		v.findViewById(R.id.todayimg);
		v.findViewById(R.id.todaytext1);
		v.findViewById(R.id.todaytext2);
		v.findViewById(R.id.todaytext3);
		v.findViewById(R.id.list);
		
		return v;
	}
	
	public  View get1stView(Context con) {
		//View v = null;
		//mInflater = LayoutInflater.from(con);
		
		v = mInflater.inflate(R.layout.activity_2p, null);
		v.findViewById(R.id.todayimg2);
		v.findViewById(R.id.todaytext1_2);
		v.findViewById(R.id.todaytext2_2);
		v.findViewById(R.id.todaytext3_2);
		v.findViewById(R.id.list2);
		
		return v;
	}
	
	public  View get2ndView(Context con) {
		//View v = null;
		// = LayoutInflater.from(con);
		
		v = mInflater.inflate(R.layout.activity_3p, null);
		v.findViewById(R.id.todayimg3);
		v.findViewById(R.id.todaytext1_3);
		v.findViewById(R.id.todaytext2_3);
		v.findViewById(R.id.todaytext3_3);
		v.findViewById(R.id.list3);
		
		return v;
	}
}
